home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
misc
/
emu
/
Apex-src.lha
/
XSEND.XPL
< prev
Wrap
Text File
|
2001-09-30
|
1KB
|
70 lines
\XSEND.XPL DEC-05-89
\Program to send either a text or binary file using the XMODEM device.
\REVISION HISTORY:
\FEB-24-86, V1.0, Original.
\APR-24-89, Insert line feeds (let the receiving computer decide if it
\ wants to strip them out or not).
\DEC-05-89, V2.0, Add option to send binary.
code CHIN=7, CHOUT=8, CRLF=9, TEXT=12,
OPENI=13, OPENO=14, CLOSE=15;
def LF= $0A, CR= $0D, EOF= $1A;
proc SENDBIN; \Send binary file
int LOC,
INLBLK,
INHBLK,
I, J;
begin
LOC:= $0562; \Location in SYSPAG
INLBLK:= LOC(0);
INHBLK:= LOC(1);
TEXT(0, "SENDING...");
OPENI(3);
OPENO(5);
for I:= INLBLK, INHBLK do
begin
for J:= 0, 255 do
CHOUT(5, CHIN(3));
CHOUT(0, ^.); \Display a dot for each block sent
end;
CLOSE(5); \Send an EOT and unfortunately an EOF
end; \SENDBIN
proc SENDTEXT; \Send text file
int CH;
begin
OPENI(3);
OPENO(5);
loop begin
repeat CH:= CHIN(3) until CH #LF; \Handle the line-feed problem
if CH =EOF then quit;
CHOUT(5, CH);
CHOUT(0, CH);
if CH =CR then CHOUT(5, LF); \Follow CR with a LF
end;
CLOSE(5); \Send an EOT and an EOF
end; \SENDTEXT
begin \MAIN
TEXT(0, "-- XMODEM FILE SENDER, V2.0 --
SEND TEXT OR BINARY FILE (T/B)? ");
if (CHIN(0)!$20) =^b then SENDBIN else SENDTEXT;
end; \MAIN
M FILE SENDER, V2.0 --
SEND TEXT OR BINARY FILE (T/B)? ");
if (CHIN(0)!$20) =^b then SENDBIN else SEN